package net.rock.service;

import net.rock.pojo.Comment;
import net.rock.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {
    @Autowired
    private CommentMapper commentMapper;

    public void add(Comment comment) {
        commentMapper.add(comment);
    }

    public List<Comment> fetchByBookId(int bookId) {
        return commentMapper.fetchByBookId(bookId);
    }

    public void del(int bookId) {
        commentMapper.del(bookId);
    }
}
